from django.contrib import admin
from django.urls import path 
from . import views
#路由文件
app_name = 'blog'

urlpatterns = [ 
  path('', views.post_list, name='post_list') ,
  # 当浏览器地址栏的路由是 /blog 
  #时，会使用views中的post_list函数处理该请求 ,
  
  path('<int:year>/<int:month>/<int:day>/<slug:post>/', 
    views.post_detail, name='post_detail') ,
    #显示特定标签的文章
  path('tag/<slug:tag_slug>/', views.post_list, name='post_list_by_tag'),
  path('<int:post_id>/share/', views.post_share, name='post_share'),
  path('search/', views.post_search, name='post_search')
  
] 
